import type { Router } from 'vue-router'
import NProgress from 'nprogress'
export const usePermission = (router: Router) => {
	router.beforeEach(async (to, from) => {
		NProgress.start()
		document.title = 'System-module-Admin'
	})

	router.afterEach((to) => {
		NProgress.done()
	})

	router.onError((handler) => {
		NProgress.done()
		console.warn('router occurence error', handler)
	})
}
